﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UI
{
    public partial class ResetPassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSet_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(username.Value) || username.Value == "请输入手机号")
            {
                tips.InnerHtml = "请输入手机号码";
                return;
            }
            if (string.IsNullOrEmpty(captcha.Value) || captcha.Value == "请输入验证码")
            {
                tips.InnerHtml = "请输入验证码";
                return;
            }
            if (Session["dtpwd"] != null && captcha.Value.Trim() != Session["dtpwd"].ToString().Trim())
            {
                tips.InnerHtml = "验证码错误!";
                return;
            }
            else
            {
                if (Session["type"] == null || (Session["type"] != null && Session["type"] as string != "getpwd") || Session["phone"] == null || (Session["phone"] != null && Session["phone"].ToString().Trim() != username.Value.Trim()))
                {

                    tips.InnerHtml = "手机号码和验证码不匹配!";
                    return;
                }
                else
                {
                    Response.Redirect("ModifyPassword.aspx");
                }
            }
        }
    }
}